import request from '@/utils/request'

/**
 * 行为列表
 * @param {Object} params 
 */
export function queryBehaviorPage(params) {
    return request({
        url: '/system/behavior/list',
        method: 'get',
        params: params
    })
}


/**
 * 行为导出
 * @param {String} id 
 */
export function behaviorExport(data) {
    return request({
        url: '/system/behavior/export',
        method: 'post',
        data: data
    })
}


/**
 * 行为详情
 * @param {String} id 
 */
export function queryBehaviorDetail(id) {
    return request({
        url: '/system/behavior/' + id,
        method: 'get'
    })
}

/**
 * 新增行为
 * @param {Object} data 
 */
export function addBehavior(data) {
    return request({
        url: '/system/behavior',
        method: 'post',
        data: data
    })
}


/**
 * 编辑行为
 * @param {Object} data 
 */
export function editBehavior(data) {
    return request({
        url: '/system/behavior',
        method: 'put',
        data: data
    })
}


/**
 * 删除行为
 * @param {String} ids 
 */
export function deleteBehavior(ids) {
    return request({
        url: '/system/behavior/' + ids,
        method: 'delete',
    })
}


/**
 * 首页隐藏行为
 * @param {String} ids 
 */
export function hideBehaviorByHome(ids) {
    return request({
        url: '/system/behavior/unRecommend/' + ids,
        method: 'put',
    })
}

/**
* 首页显示行为
* @param {String} ids 
*/
export function showbehaviorByHome(ids) {
    return request({
        url: '/system/behavior/recommend/' + ids,
        method: 'put',
    })
}